package com.lh.music.fragment.discover;


import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.ImageView;

/**
 * A simple {@link Fragment} subclass.
 */
public abstract class BaseFragment extends Fragment {
    private View view;
     boolean isVisiable=false;
     boolean isPrepare=false;
    private Context context;
    //正在加载的imageview
    private AnimationDrawable anim;
    private ImageView iv;
    public BaseFragment() {
        // Required empty public constructor
    }

    @Override
    public void onAttach(Context context) {
        this.context=context;
        super.onAttach(context);
    }



    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {
        if (isVisibleToUser){
            isVisiable=true;
            lazyLoad();
        }else{
            isVisiable=false;
        }
    }

    protected abstract void lazyLoad();


}
